package RentCar;

import java.util.Scanner;

public class Trunk extends Vehicle{
    private String type;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Trunk() {
        ;
    }

    public Trunk(String vehicleId, String brand, int perRent, String type) {
        super(vehicleId, brand, perRent);
        this.type = type;
    }

    @Override
    public float calRent(int days) {
        if(days>=150){
            return super.calRent(days)*0.6f;
        }
        else if(days>=30){
            return super.calRent(days)*0.7f;
        }
        else if(days>=7){
            return super.calRent(days)*0.8f;
        }
        else{
            return super.calRent(days);
        }
    }
    @Override
    public void leaseOutFlow() {
        System.out.println("1.东方  2.福田");
        System.out.print("请选择你要租贷的轿车品牌:");
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        if(a==1){
            this.type="东方";
        }
        else{
            this.type="福田";
        }
        if("宝马".equals(this.type)){
            System.out.println("1.5吨  2.10吨");
            System.out.print("请选择你要租贷的货车型号");
            int b=scanner.nextInt();
            if(b==1){
                this.setBrand("5顿");
                setPerRent(600);
                setVehicleId("川CNY3284");
            }
            else{
                this.setBrand("10顿");
                setPerRent(800);
                setVehicleId("川NY28588");
            }
        }
        else{
            System.out.println("1.15吨  2.20吨");
            System.out.print("请选择你要租贷的货车型号");
            int b=scanner.nextInt();
            if(b==1){
                this.setBrand("15吨");
                setPerRent(300);
                setVehicleId("川NT37465");
            }
            else{
                this.setBrand("20吨");
                setPerRent(600);
                setVehicleId("川NT96968");
            }
        }
    }
}
